package net.alpcontrol.bi.colligation.service.impl;

import net.alpcontrol.bi.colligation.entity.PjProjectInfo;
import net.alpcontrol.bi.colligation.mapper.PjProjectInfoMapper;
import net.alpcontrol.bi.colligation.service.IPjProjectInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 丛庆
 * @since 2020-09-11
 */
@Service
@Transactional
public class PjProjectInfoServiceImpl extends ServiceImpl<PjProjectInfoMapper, PjProjectInfo> implements IPjProjectInfoService {

    @Autowired
    private PjProjectInfoMapper pjProjectInfoMapper;

    /**
      *  分页查询
      * @param bootStrapTable
      * @param pjProjectInfo
      * @return
      */
    @Override
    public IPage<PjProjectInfo> selectPage(Page<PjProjectInfo> page) {
        return pjProjectInfoMapper.selectPage(page,null);
    }

    /**
     * 根据月份和名称查询在建项目数据
     * @param beginMonth
     * @param endMonth
     * @param pjName
     * @return
     */
    @Override
    public List<PjProjectInfo> queryBuildingByMonthAndName(String beginMonth, String endMonth, String pjName) {
        Map<String,String> param = new HashMap<>();
        param.put("beginMonth",beginMonth);
        param.put("endMonth",endMonth);
        param.put("pjName",pjName);
        return pjProjectInfoMapper.queryBuildingByMonthAndName(param);
    }
    /**
     * 根据月份和名称查询运维项目数据
     * @param beginMonth
     * @param endMonth
     * @param pjName
     * @return
     */
    @Override
    public List<PjProjectInfo> queryOpsByMonthAndName(String beginMonth, String endMonth, String pjName) {
        Map<String,String> param = new HashMap<>();
        param.put("beginMonth",beginMonth);
        param.put("endMonth",endMonth);
        param.put("pjName",pjName);
        return pjProjectInfoMapper.queryOpsByMonthAndName(param);
    }

}
